<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		
	<!--//工厂函数-->
	    <script type="text/javascript">
	    	function fn(){
	    	   	var car = new Object();
	    	   	car.name = "宝马";
	    	   	car.hege = "合格";
	    	   	car.shuoming = "宝马123"
	    	   	return car
	    	}
	    	var car = fn();
	    	alert(car.name)
	    	
	    	
	    	
	 //构造函数
	       function person(a,b,c,d,e){
	       	    this.age = a;
	       	    this.sex = b;
	       	    this.boyfirend = c;
	       	    this.speak = d;
	       	    this.essay = e;
	       }
	       var person1 = new person("18","男","老王","英语","小品")
	       alert(person1.age)
	   </script>
	</body>
</html>
